<%--
  Created by IntelliJ IDEA.
  User: Wang Ziming
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
    <div class="nav-ann">
        <span>公告</span>
    </div>
    <hr>
    <div>
        <%--公告内容--%>
        <textarea id="content"></textarea>
        <button type="button" id="announceBtn">发布</button>
    </div>
</body>
<%--css--%>
<style type="text/css">
    .nav-ann{
        margin-top: 3%;
    }
</style>

<%--js--%>
<script type="text/javascript" src="/js/jquery.min.js"></script>
<script>
    $(function () {
        $("#announceBtn").click(function () {
            //发布到相应的方法中
            $.post("/admin/postToIndex",{
                announceContent:$("#content").val()
            });
            //提示发布成功
            alert("发布成功");
            console.log("发布成功");
        });
    })
</script>
</html>
